package org.cst8277.ums.nas.listeners;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;
import org.cst8277.ums.nas.entity.ConnectionInfo;

import java.util.List;


@Data
@Slf4j
public class ConnectionInfoListener extends AnalysisEventListener<ConnectionInfo> {
    private List<ConnectionInfo> connectionInfoList = Lists.newArrayList();

    @Override
    public void invoke(ConnectionInfo connectionInfo, AnalysisContext analysisContext) {
        log.info("connectionInfo:{}", connectionInfo);
        this.connectionInfoList.add(connectionInfo);
    }


    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        log.info("[互联关系]数据读取完成");
    }
}
